package com.bosssoft.cloud.wechat.core.bean.param.portal;

import com.alibaba.fastjson.annotation.JSONField;
import com.bosssoft.cloud.wechat.core.bean.WxBaseMsg;
import com.bosssoft.cloud.wechat.infrastructure.constant.WxKeywordConsts;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * 回复文本消息
 * <p>
 * 详细请参考官方文档：
 * https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Receiving_event_pushes.html
 *
 * @author wcy create on 2021/5/27 11:53 上午
 */
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class EventParam extends WxBaseMsg {

    /**
     * 事件类型，subscribe(订阅)、unsubscribe(取消订阅)
     */
    @JSONField(name = "Event")
    private String event;

    /**
     * 事件KEY值，qrscene_为前缀，后面为二维码的参数值
     */
    @JSONField(name = "EventKey")
    private String eventKey;

    /**
     * 二维码的ticket，可用来换取二维码图片
     */
    @JSONField(name = "Ticket")
    private String ticket;

    /**
     * 地理位置纬度
     */
    @JSONField(name = "Latitude")
    private String latitude;

    /**
     * 地理位置经度
     */
    @JSONField(name = "Longitude")
    private String longitude;

    /**
     * 地理位置精度
     */
    @JSONField(name = "Precision")
    private String precision;


    public EventParam(String toUserName, String fromUserName) {
        super(toUserName, fromUserName, String.valueOf(System.currentTimeMillis() / 1000), WxKeywordConsts.MsgType.EVENT);
    }


}
